# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer : Ionut Biru <ibiru@archlinux.org>
# Contributor: Joeny Ang <ang(dot)joeny(at)gmail(dot)com>

pkgname=shotwell
epoch=2
pkgver=0.32.3
_basever=${pkgver%.*}
pkgrel=1
pkgdesc="A digital photo organizer designed for the GNOME desktop environment (odd versions are unstable!)"
arch=('loong64' 'x86_64')
url="https://wiki.gnome.org/Apps/Shotwell"
license=('LGPL2.1')
depends=('libgee' 'webkit2gtk-4.1' 'libgexiv2' 'libraw' 'rest'
	 'desktop-file-utils' 'dconf' 'hicolor-icon-theme' 'json-glib'
	 'gst-plugins-base' 'libgphoto2' 'libgudev'
	 'gcr' 'libgdata' 'libportal-gtk3')
makedepends=('intltool' 'vala>=0.17.2' 'itstool' 'meson' 'ninja' 'cmake')
# odd versions are unstable!
source=("https://download.gnome.org/sources/shotwell/${_basever}/shotwell-$pkgver.tar.xz")
sha256sums=('e000fee5b3f362c79114f0ecff8e22b34c9a2865b59e41a2da3e4dc5d2ca2c3c')

prepare() {
  cd ${pkgname}-${pkgver}
  # fix string format in translation. It uses cyrillic-`e` instead of `e`.
  sed -i 's#%е#%e#g' po/ru.po
}

build() {
  arch-meson ${pkgname}-${pkgver} build
  ninja -C build
}

package() {
  DESTDIR="${pkgdir}" meson install -C build
}
